Skip to content

fix: use single copy of core spec from profiler - #24

Merged
colinjlacy merged 1 commit into
runtimeconditions:mainfrom
abhinavkdeval08-design:fix/single-copy-core-spec-15
Nov 25, 2026
Merged

colinjlacy merged 1 commit into
runtimeconditions:mainfrom
abhinavkdeval08-design:fix/single-copy-core-spec-15

Conversation

@abhinavkdeval08-design

@abhinavkdeval08-design abhinavkdeval08-design commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Resolves #15 by keeping a single embedded copy of the core profile schema, in the linked Go profiler, and having rc's validator read it from there.

Background

The core spec was embedded twice via -ldflags, from the same value in scripts/build.go and scripts/release-package.py:

  1. internal/validate.coreSchemaBase64, used by rc profile validate
  2. go-rc-profiler/extensioncheck.installedCoreSchemaBase64, used by the linked Go profiler for rc profile generate

Following the discussion in #15, runtimeconditions/go-rc-profiler#10 added extensioncheck.InstalledCoreSchema() and extensioncheck.ErrNoInstalledCoreSchema, released in go-rc-profiler v0.9.0.

Changes

  • internal/validate/core.go: reads the embedded schema through extensioncheck.InstalledCoreSchema() and maps ErrNoInstalledCoreSchema to the existing errNoCoreSchema ("this build of rc has no verified core profile schema"). A decode error is returned as is. UseCoreSchema stays as the test and bring-your-own-schema hook.
  • scripts/build.go, scripts/release-package.py: removed the -X ...internal/validate.coreSchemaBase64 flag; the profiler variable is now the only embedded copy. Updated the stale comment.
  • internal/validate/embed_test.go: TestEveryBuildEmbedsOnlyTheProfilerCoreSchema checks that both build scripts set the profiler variable and no longer set the validator one, so the second copy can't come back.
  • go.mod, go.sum: go-rc-profiler v0.8.0 -> v0.9.0.
  • distribution/components.lock.yaml: goProfiler updated to v0.9.0 (commit 324969e718e6fdaf3ebe3ca40e3beb4b735cd587, with the archive and executable SHA-256s of the v0.9.0 release assets).

Closes #15

Consolidate the core spec into a single source of truth embedded in the linked Go profiler, and have the CLI validator read it from there.

- Read core schema via extensioncheck.InstalledCoreSchema() in internal/validate
- Remove duplicate -X flag for internal/validate.coreSchemaBase64 from build.go and release-package.py
- Update embed guard test to assert only the profiler variable is embedded
- Bump go-rc-profiler to v0.9.0 and update distribution/components.lock.yaml

Closes runtimeconditions#15

Signed-off-by: Abhinav Deval <abhinavkdeval08@gmail.com>
Comment thread go.mod Resolved
@colinjlacy
colinjlacy merged commit 5a35e86 into runtimeconditions:main Nov 25, 2026
4 checks passed
@abhinavkdeval08-design

Copy link
Copy Markdown
Member Author

Thanks for the review and merge, @colinjlacy! Glad to have this landed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Only include one copy of core spec

2 participants